<?php
sleep(1); 
/*print_($_FILES);
die();*/

/*$uploaddir = 'C:/wamp/www/sapt/sapt/public/upd_arquivos/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
  $msg = "Sucesso";
} else {
  // WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE!
  // Otherwise onSubmit event will not be fired
  $msg = "Erro ao enviar arquivo";
}
*/

/*echo json_encode(array(
    'mensagem' => $msg
));*/
$uploaddir = 'C:/wamp/www/sapt/sapt/public/upd_arquivos/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);

echo json_encode(array(
    'files' => $_FILES,
    'post' => $_POST
));